package com.example.feed.multichannel;

import android.content.Context;

import com.x.uikit.channel.feed.IXFeed;

public class CardFactory implements IXFeed.CardFactory {
    interface CardType {
        int IMAGE_TEXT = 1;
        int VIDEO = 2;
    }

    private static CardFactory sInstance = new CardFactory();

    public static CardFactory get() {
        return sInstance;
    }

    private CardFactory() {
    }

    @Override
    public BaseCard getCard(Context context, int cardType) {
        BaseCard card = null;
        switch (cardType) {
            case CardType.IMAGE_TEXT:
                card = new ImageTextCard(context);
                break;
            case CardType.VIDEO:
                card = new VideoCard(context);
                break;
        }
        return card;
    }
}
